<div class="container"> 
	<div class="row"> 
		<div class="panel panel-info">
			<div class="panel-heading">
				<div class="panel-title">Purchase DNS service</div>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-md-12">
						<div class="well">
							<h3>Purchase DNS service</h3>
							<hr style="background:skyblue;height:1px;">
							<div class="row">
								<div class="col-md-12" >
									<h4>Enter the domains you would like to use with this service</h4>
									<form class="form-horizontal" role="form" action="<?=base_url('users/dnshosting_purchase')?>" method="post">
										<div class="form-group">
											<label for="inputEmail3" class="col-sm-2">Domain Name </label>
											<div class="col-sm-6">
												<input class="form-control" name="domainname" id="domainname" placeholder="Please enter domain" onkeyup="CheckDomainInput()"/>
											</div>
										</div>
										<div class="form-group">
											<label for="inputEmail3" class="col-sm-2">3rd Party Setup </label>
											<div class="col-sm-6">
												<div class="sFormCol2">
													In order to set up DNS Hosting, you must set the name servers at your current registrar to point to the following name servers. You should check with your existing registrar to ensure that they allow this type of change.
													<table cellspacing="0" style="width:325px;margin:10px;" class="table">
														<thead>
															<tr class="success">
																<th>Server</th>
																<th>Name</th>
															</tr>
														</thead>
														<tbody><tr>
															<td>Primary</td>
															<td>DNS1.NAME-SERVICES.COM</td>
														</tr>
														<tr>
															<td>Secondary</td>
															<td>DNS2.NAME-SERVICES.COM</td>
														</tr>
														<tr>
															<td>Secondary</td>
															<td>DNS3.NAME-SERVICES.COM</td>
														</tr>
														<tr>
															<td>Secondary</td>
															<td>DNS4.NAME-SERVICES.COM</td>
														</tr>
														<tr>
															<td>Secondary</td>
															<td>DNS5.NAME-SERVICES.COM</td>
														</tr>
													</tbody></table>
												</div>
											</div>
										</div>
										<div class="form-group">
											<div class="col-sm-offset-2 col-sm-10">
											  <button type="submit" class="btn btn-warning" id="dnsbtn" disabled="disabled">Continue</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>	
			</div>
		</div>
	</div>
</div>
<script>
function CheckDomainInput()
{
	var inputSingle = $("#domainname").val();
	//var inputSingleAuthCode = $("#AuthInfo1").val();
	var activateButton = false;
	if(inputSingle !="")
	{
		if (inputSingle.indexOf(".") != -1) 
		{
			var inputArray = inputSingle.split(".");
			localTLD = inputArray[1];
			//alert(localTLD);
			if (localTLD != "") 
			{			
				activateButton = true;
			}
		}
		else
		{
			activateButton = false;
		}
		
	}
	else
	{	
		activateButton = false;
	}
	if (activateButton) {
		// Activate submit button
		$("#dnsbtn").removeAttr("disabled");
	} else {
		// Deactivate submit button
		$("#dnsbtn").attr("disabled", "disabled");
	}
}
</script>
